#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
int main()
{
	int n, t;
	scanf("%d", &n);
	int arr[1001] = { 0 };
	int j = 0;
	for (int i = 0; i < n; i++)
	{
		scanf("%d", &t);
		if (arr[t] == 0)
		{
			arr[t] = 1;
			j++;
		}
	}
	printf("%d\n", j);
	for (int i = 1; i <= 1000; i++)
	{
		if (arr[i] == 1)
			printf("%d ", i);
	}
	return 0;
}